/**
 * Copyright (c) 时间, Tal.Ben 袁东昊 (ydonghao2@gmail.com).
 *
 * 版权
 */
package com.talben.soudian.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import butterknife.ButterKnife;
import butterknife.InjectView;

import com.talben.soudian.R;
import com.talben.soudian.base.BaseFragment;

/**
 * @Title: CooperationFragment.java
 * @Package com.talben.soudian.fragment
 * @Description: TODO(添加描述)
 * @author Tal.Ben
 * @date 2015年6月22日 下午6:17:29
 * @version v1.0
 */
public class CooperationFragment extends BaseFragment {
	
	@InjectView(R.id.wb_all)
	WebView mWebChinaPost;
	
	@Override
	public View onCreateView(LayoutInflater inflater,
			ViewGroup container, Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.fragment_web_view, container,
				false);
		ButterKnife.inject(this, view);
		
        mWebChinaPost.getSettings().setBuiltInZoomControls(true);
        mWebChinaPost.loadUrl("http://www.chinapost.com.cn/xhtml1/folder/1407/1001-1.htm");  
        mWebChinaPost.setWebViewClient(new WebViewClient(){  
	        @Override  
	        public boolean shouldOverrideUrlLoading(WebView view, String url) {  
	            // TODO Auto-generated method stub  
	            view.loadUrl(url);// 使用当前WebView处理跳转  
	            return true;//true表示此事件在此处被处理，不需要再广播  
	        }  
	        @Override   //转向错误时的处理  
	        public void onReceivedError(WebView view, int errorCode,  
	            String description, String failingUrl) {  
	        }
        });
        return view;
    }

}

